#!/bin/bash

######################################################
### After layers are estimated   #####################
### we can extract the respective profiles ###########
######################################################
#this script aims extract profiles from a given region layer file

#For condition 1 (e.g. BOLD)
LN2_PROFILE -input scaled_cond_1a.nii.gz -layers rim_layers_equivol.nii.gz -plot -output layer_profile_cond_1a.txt

#for condition 2 (e.g. VASO)
LN2_PROFILE -input scaled_cond_2a.nii.gz -layers rim_layers_equivol.nii.gz -plot -output layer_profile_cond_2a.txt

#For condition 1 (e.g. BOLD, early response)
LN2_PROFILE -input scaled_cond_1b.nii.gz -layers rim_layers_equivol.nii.gz -plot -output layer_profile_cond_1b.txt

#for condition 2 (e.g. BOLD, late response)
LN2_PROFILE -input scaled_cond_2b.nii.gz -layers rim_layers_equivol.nii.gz -plot -output layer_profile_cond_2b.txt

1dplot -one -ok_1D_text -xlabel 'layers from WM (left) to CSF (right)' -ylabel 'fMRI respose in percent' 'layer_profile_cond_1a.txt[1]' 'layer_profile_cond_2a.txt[1]'

1dplot -one -ok_1D_text -xlabel 'layers from WM (left) to CSF (right)' -ylabel 'fMRI respose in percent' 'layer_profile_cond_1b.txt[1]' 'layer_profile_cond_2b.txt[1]'